﻿<CustomWindow:EssentialWindow x:Class="Synrc.LogonWindowXP"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:CustomWindow="clr-namespace:CustomWindow;assembly=CustomWindow"       
    xmlns:mwt="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    Title="Logon Dialog" Height="218" Width="401"
    MouseLeftButtonDown="Window_MouseLeftButtonDown" 
    ResizeMode="NoResize" 
    AllowsTransparency="True" Background="Transparent" 
    WindowStartupLocation="CenterOwner" 
    SizeToContent="Manual" ShowInTaskbar="False" 
    Loaded="Window_Loaded" KeyDown="Window_KeyDown">
    
    <Window.Resources>
        <LinearGradientBrush x:Key="ButtonNormalBackground"
                         StartPoint="0,0"
                         EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStop Color="#F3F3F3"
                          Offset="0"/>
                <GradientStop Color="#EBEBEB"
                          Offset="0.5"/>
                <GradientStop Color="#DDDDDD"
                          Offset="0.5"/>
                <GradientStop Color="#CDCDCD"
                          Offset="1"/>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2"
                               StrokeThickness="1"
                               Stroke="Black"
                               StrokeDashArray="1 2"
                               SnapsToDevicePixels="true"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <SolidColorBrush x:Key="ButtonNormalBorder"
                     Color="#FF707070"/>

        <Style x:Key="BaseButtonStyle"
           TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle"
                Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="Background"
                Value="{StaticResource ButtonNormalBackground}"/>
            <Setter Property="BorderBrush"
                Value="{StaticResource ButtonNormalBorder}"/>
            <Setter Property="BorderThickness"
                Value="1"/>
            <Setter Property="Foreground"
                Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment"
                Value="Center"/>
            <Setter Property="VerticalContentAlignment"
                Value="Center"/>
            <Setter Property="Padding"
                Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <mwt:ButtonChrome Name="Chrome"
                                        Background="{TemplateBinding Background}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        RenderDefaulted="{TemplateBinding Button.IsDefaulted}"
                                        RenderMouseOver="{TemplateBinding IsMouseOver}"
                                        RenderPressed="{TemplateBinding IsPressed}"
                                        SnapsToDevicePixels="true">
                            <ContentPresenter Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </mwt:ButtonChrome>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused"
                                 Value="true">
                                <Setter TargetName="Chrome"
                                    Property="RenderDefaulted"
                                    Value="true"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked"
                                 Value="true">
                                <Setter TargetName="Chrome"
                                    Property="RenderPressed"
                                    Value="true"/>
                            </Trigger>
                            <Trigger Property="IsEnabled"
                                 Value="false">
                                <Setter Property="Foreground"
                                    Value="#ADADAD"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type Button}"
           BasedOn="{StaticResource BaseButtonStyle}"
           TargetType="{x:Type Button}"/>
        
    </Window.Resources>

    <Border BorderBrush="Black" BorderThickness="1" CornerRadius="5" Background="Transparent">
        <Border BorderThickness="0" CornerRadius="5">
            <DockPanel>
                <Border Height="26" BorderThickness="0" CornerRadius="5" DockPanel.Dock="Top">
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="DodgerBlue" Offset="0" />
                            <GradientStop Color="DodgerBlue" Offset="0.3" />
                        </LinearGradientBrush>
                    </Border.Background>
                    <Border Name="WindowButtonsPlaceholder" HorizontalAlignment="Right" VerticalAlignment="Top"
                             Margin="0,0,10,0" />
                </Border>

                <Border BorderThickness="0" CornerRadius="5" Margin="0,-10,0,0">
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="DodgerBlue" Offset="0" />
                            <GradientStop Color="Azure" Offset="0.9" />
                        </LinearGradientBrush>
                    </Border.Background>

                    <Grid OpacityMask="Azure">
                        <TextBox Height="23" Margin="129,12,12,0" x:Name="usernameBox" VerticalAlignment="Top" VerticalContentAlignment="Center" TabIndex="1" TextDecorations="None" ForceCursor="True" />
                        <Label Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" x:Name="loginLabel" VerticalAlignment="Top" Width="111" FlowDirection="RightToLeft" VerticalContentAlignment="Center" TabIndex="6" IsTabStop="False" x:Uid="loginLabel">Username</Label>
                        <Label HorizontalAlignment="Left" Margin="12,41,0,0" x:Name="passLabel" Width="111" FlowDirection="RightToLeft" Height="23" VerticalAlignment="Top" VerticalContentAlignment="Center" TabIndex="7" IsTabStop="False" x:Uid="passLabel">Password</Label>
                        <CheckBox Margin="129,121,12,0" x:Name="checkBox1" TabIndex="3" IsChecked="True" x:Uid="rememberYou" Height="16" VerticalAlignment="Top">Remember Settings</CheckBox>
                        <ComboBox Margin="129,92,111,0" x:Name="comboBox1" TabIndex="4" Height="23" VerticalAlignment="Top">
                            <ComboBoxItem IsSelected="True" x:Uid="humanCombo">Given Middle Family</ComboBoxItem>
                            <ComboBoxItem x:Uid="machineCombo">Family Given Middle</ComboBoxItem>
                        </ComboBox>
                        <Button Height="23" HorizontalAlignment="Right" Margin="0,0,12,12" x:Name="button1" VerticalAlignment="Bottom" Width="75" Click="button1_Click" TabIndex="5" IsDefault="True" x:Uid="signIn">Sign In</Button>
                        <PasswordBox Height="23" Margin="129,41,12,0" x:Name="passwordBox" VerticalAlignment="Top" TabIndex="2" />
                        <Label Margin="0,0,93,12" x:Name="providerName" FlowDirection="RightToLeft" Padding="3" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="157">Service Name</Label>
                        <Image HorizontalAlignment="Left" Margin="12,70,0,10" x:Name="image1" Stretch="None" Width="100" />
                        <CheckBox Height="16" IsChecked="False" Margin="129,70,12,0" x:Name="checkBox2" TabIndex="3" VerticalAlignment="Top" IsEnabled="False">Read Only</CheckBox>
                    </Grid>


                </Border>
            </DockPanel>
        </Border>
    </Border>
    
</CustomWindow:EssentialWindow>
